//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.StringPractise;

public class StringPrecatiseSix {
    public StringPrecatiseSix() {
    }

    public static void main(String[] args) {
        System.out.println(number("18939178490"));
        System.out.println(birth("410883200307180192"));
        System.out.println(word("你真是个智障啊，脑残东西"));
    }

    public static String number(String str) {
        if (str.length() == 11) {
            String var10000 = str.substring(0, 3);
            return var10000 + "****" + str.substring(7);
        } else {
            return "号码有误";
        }
    }

    public static String birth(String str) {
        String var10000 = str.substring(6, 10);
        return "人物信息为：\n出生年月日：" + var10000 + "年" + str.substring(10, 12) + "月" + str.substring(12, 14) + "日\n性别为：" + (str.charAt(16) % 2 != 0 ? "男" : "女");
    }

    public static String word(String str) {
        String[] words = new String[]{"尼玛的", "傻逼", "脑残东西", "智障啊"};

        for(int i = 0; i < words.length; ++i) {
            str = str.replace(words[i], "*".repeat(words[i].length()));
        }

        return str;
    }
}
